package cn.ml.duoXianCheng.threadDemo;

import java.util.List;

/**
 * 实现Runnable接口方式创建线程
 */
public class MyRunnableDemo1 implements Runnable{

    @Override
    public void run() {
        for (int i=0;i<100;i++) {
            System.out.println(Thread.currentThread().getName() +"___"+ i);
        }
    }

    public static void main(String[] args) {
        //创建线程对象
        Runnable runnable = new MyRunnableDemo1();
        Thread thread = new Thread(runnable);
        Thread thread1 = new Thread(runnable,"MyThread");//修改线程名
        thread.start();
        thread1.start();
        //thread.run();
        //thread1.run();
    }




}
